/*  Copyright 2010 Daniel Brasil Magnani
 *  Created on: Dec 20, 2010
 *      Author: daniel */

#include "instance.h"
#include "gtest/gtest.h"

class InstanceTest : public testing::Test {
  protected:
    char hprc_mock_[256];
    char lprc_mock_[256];
    char baseline_mock_[256];

    virtual void SetUp() {
      strcpy(hprc_mock_, "hprc");
      strcpy(lprc_mock_, "lprc");
      strcpy(baseline_mock_, "baseline");
      Instance::get_instance().Init(hprc_mock_, 0);
    }
};

TEST_F(InstanceTest, ReadPaintInput) {
  EXPECT_GT(Instance::get_instance().get_paint_batch_limit(), 0);
  EXPECT_LT(Instance::get_instance().get_paint_batch_limit(), 1500);
}

TEST_F(InstanceTest, ReadConstraints) {
  std::vector<Constraint> c1;
  c1 = Instance::get_instance().get_constraint_list();
  EXPECT_GT(c1.size(), 0);
  EXPECT_LT(c1.size(), 500);

  for (int i = 0;i < c1.size();i++) {
    EXPECT_GT(c1[i].n, 0);
    EXPECT_GT(c1[i].p, 0);
    EXPECT_GT(c1[i].p, c1[i].n);
  }
}

TEST_F(InstanceTest, ReadVehicles) {
  std::vector<Car> yesterday;
  std::vector<Car> today;
  yesterday = Instance::get_instance().get_yesterday_cars();
  today = Instance::get_instance().get_today_cars();
  EXPECT_GT(yesterday.size(), 0);
  EXPECT_GT(today.size(), 0);
}
